package com.example.esp8266.Init;

import android.app.Application;
import androidx.room.Room;

import com.example.esp8266.Library.RoomLib.AppDatabase;

public class ESP8266_APP extends Application {
    private static ESP8266_APP instance;
    private AppDatabase database;

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        database = Room.databaseBuilder(getApplicationContext(), AppDatabase.class, "app-database")
                .fallbackToDestructiveMigration()
                .build();
    }

    public static ESP8266_APP getInstance() {
        return instance;
    }

    public AppDatabase getDatabase() {
        return database;
    }
}